type NerverToUndefine<T> = [T] extends [never] ? undefined : T;

type ObjectEntries<T, S extends keyof T = keyof T> = S extends S
  ? [S, NerverToUndefine<Required<T>[S]>]
  : never;

interface Model {
  name: string;
  age: number;
  locations: string[] | null;
}

type der = ObjectEntries<Partial<Model>>;
